package com.xiangge.oop;

class Student2 {
    static int num;
    static {
        System.out.println("静态代码块执行 num:" + ++num);
    }
    {
        System.out.println("构造代码块执行 num:" + ++num);
    }
    public Student2() {
        System.out.println("无参构造方法在执行 num:" + ++num);
    }
    public Student2(int number) {
        this();
        System.out.println("有参构造方法在执行 num:" + ++num);
    }
}
public class BlockDemo {
    public static void main(String[] args) {
        new Student2(3);
        new Student2();
    }
}
